package com.boot;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pojo.User;
import com.service.UserService;

@Controller
public class IndexController {

	@Resource
	private UserService userService;
	
	@RequestMapping("/")
	@ResponseBody
	public String say() {
		return "Hello,World!!";
	}
	
	@RequestMapping("/haha")
	public String say1(Model model) {
		List<User> uList = userService.getAll();
		model.addAttribute("uList", uList);
		return "haha";
	}
}
